<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html class="no-js">
<head>
  <meta charset="UTF-8">
  <title>兑换记录</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="format-detection" content="telephone=no">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <jsp:include page="/jsp/inc.jsp"></jsp:include>
</head>
<body>
<ul class="duihuanrecord">
    <c:choose>
        <c:when test="${not empty listHistory}">
            <c:forEach items="${listHistory}"  var="obj" varStatus="vs">
                <li onclick="toGoodsDetailByCode('${obj.detailId}','${obj.goodsId}');">
                    <img src="<%=ConfigUtil.get("OSSURL")%>${obj.path}" alt="" class="getgdimg">
                    <div class="recordinfo">
                        <div class="recordtitle">${obj.name}</div>
                        <div class="recorddown">
                            <c:if test="${obj.state == 1}">
                                <div class="fl-l"><span class="waittingdh">等待兑换</span></div>
                                <div class="fl-r">${obj.price}积分</div>
                                <br class="clear"/>
                            </c:if>
                            <c:if test="${obj.state == 2}">
                                <div class="fl-l"><span class="workeddh">兑换成功</span></div>
                                <div class="fl-r">${obj.price}积分</div>
                                <br class="clear"/>
                            </c:if>
                        </div>
                    </div>
                </li>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <div class="notxt">
                <img src="<%=basePath%>resources/image/icon-nullnull.png" alt="" class="notxtImg">
                <div class="nultxttip">暂无记录</div>
            </div>
        </c:otherwise>
    </c:choose>
</ul>
<script>
    function toGoodsDetailByCode(detailId, goodsId){

        window.location.href='${pageContext.request.contextPath}/goods/toGoodsDetail.ac?goodsId='+goodsId+'&detailId='+detailId;
    }
</script>
</body>
</html>

